import zipfile
import os
import sys

zipname = "turing-puzzle.zip"


zf = zipfile.ZipFile(zipname, mode="w")

for dirname, dirnames, filenames in os.walk('.'):
    if dirname=='.':
        for filename in filenames:
            if filename==zipname or filename==os.path.basename(sys.argv[0]):
                continue
            zf.write(filename)
    else:
        if dirname.startswith("."+os.sep+"."):
            continue
        if dirname.startswith("."+os.sep+"experiments"):
            continue

        for filename in filenames:
            zf.write(os.path.join(dirname, filename))

zf.close()